#include"comm.hpp"
#include<unistd.h>

int main()
{
    //1.创建key
    key_t k = getKey();
    cout << "server: " << toHex(k) << endl;

    //2.创建共享内存
    int shmid = createShm(k,gsize);
    cout << "server shmid: "<< shmid << endl;

    //3.与共享内存关联起来
    char* start = attachShm(shmid);

    //4.与共享内存解除关联
    detachShm(start);

    //5.删除共享内存
    delshm(shmid);

    return 0;
}
